package leetcode.tree;

import leetcode.tree.common.TreeNode;
import leetcode.tree.common.TreeUtils;

import java.util.Arrays;
import java.util.List;

/**
 * AC
 */
class Solution101 {
    public boolean isSymmetric(TreeNode root) {
        return TreeUtils.isSymmetricByBFS(root);
    }
}

/**
 * 101. 对称二叉树
 */
public class leetcode101 {

    public static void main(String[] args) {

//        Integer[] arrP = {1,2,2,3,4,4,3};
//        Integer[] arrP = {1,2,2,null,3,null,3};
        Integer[] arrP = {1, 2, 3};
        List<Integer> nodeListP = Arrays.asList(arrP);
        TreeNode root = TreeUtils.generateAtreeByBFSList(nodeListP);

        Solution101 solution101 = new Solution101();

        System.out.println(solution101.isSymmetric(root));

    }

}
